/**
 * Project: demo.web
 * 
 * File Created at 2009-9-29
 * $Id$
 * 
 * Copyright 2008 Alibaba.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.alibaba.hello.controller;

import java.util.Map;

import com.alibaba.hello.dataobject.User;
import com.alibaba.roma.core.annotations.Form;
import com.alibaba.roma.core.form.validation.Errors;
import com.alibaba.roma.web.servlet.result.Forward;
import com.alibaba.roma.web.servlet.result.View;
import com.alibaba.roma.web.servlet.result.WebResult;

/**
 * TODO Comment of RegisterController
 * @author sesame.yangj
 *
 */
public class RegisterController {
    
    @SuppressWarnings("unchecked")
    @Form(group = "register")
    public WebResult doRegister(Errors errors, User user, Map model){
        model.put("user", user);
        if (errors.hasErrors()) {           
            return new View("user_register");
        } else {
            return new Forward("/hello/welcome/index");
        }
    }
}
